﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<VSA.Presentation.Models.ToDoCustomerItem>" %>
<%@ Import Namespace=" MVCControlsToolkit.Core" %>
<%@ Import Namespace=" MVCControlsToolkit.Controls" %>
    
        <%:Html.IsValid() %>
        <% if (Model != null)
           {%>
        <%: Html.ValidationSummary(true)%>
        
        <fieldset>
            <legend>Edit ToDo</legend>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.CustomerId)%>:
                <%: Html.TextBoxFor(model => model.CustomerId)%>
                <%: Html.HiddenFor(model => model.CustomerId)%>
                <input type="hidden" name="mode" value="Insert"/>
            </div>
            <div class="editor-field">
                <%: Html.LabelFor(model => model.CompanyName)%>
                <%: Html.TextBoxFor(model => model.CompanyName)%>
                <%: Html.HiddenFor(model => model.CompanyName)%>
            </div>
            
           <script language='javascript' type='text/javascript'>
               $(document).ready(function () {
                   $('#prova').unbind();
                   $('#prova').click(function () {
                       $(this).parents('form').submit();
                       return false;
                   });
               });
            </script>
                    
            <p>
                <input type="submit" value="Save"/>
            </p>
             
        </fieldset>
        <% }

           else
           { %>

           <div> Record has been deleted </div>

           <% } %>
 

